<template>
  <div class="container">
    <router-link v-for="(item, index) in list" :key="index" :to="`/courseRecordDetail?id=${item.id}&name=${item.kcname}`">
      <div class="item">{{ item.kcname }}签到记录</div>
    </router-link>
  </div>
</template>

<script>
import api from '@/api'
export default {
  name: 'course-record',
  data () {
    return {
      list: []
    }
  },
  methods: {
    getList () {
      let params = {teacher_id: JSON.parse(sessionStorage.getItem('user')).id}
      api.teacherCourseRecord({
        params,
        callback: res => {
          if (res.data.error_code === 0) {
            this.list = res.data.data
          }
        }
      })
    }
  },
  created () {
    this.getList()
  }
}
</script>

<style scoped>
  .container{
    height: 100%;
    background-color: #f2f3f5;
    padding-top: 10px;
    box-sizing: border-box;
  }
  .item{
    margin-bottom: 10px;
    height: 40px;
    line-height: 40px;
    background-color: #fff;
    color: #1E1E1E;
    text-align: center;
  }
</style>
